<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>getElement</title>
	<script>
	window.onload = function(){
	p= document.getElementsByTagName('p');
	p[0].style.fontSize="100px";
	p[1].style.color="blue";

	console.log(p)

	for(var x=0;x<p.length;x++){
		// alert(x);
		p[x].style.color="red";
		p[x].style.textAlign="center";
	}
	p[0].onmouseover=function(){
		p[1].style.display="none";
	}
	p[0].onmouseout=function(){
		p[1].style.display="block";
	}
	abc = document.getElementById('abc');
	abc.style.color="red";
	for(var i=0;i<p.length;i++){
		p[i].onclick=function(){
			alert("message")
		}
	}
	input = document.getElementById('input');
	info = document.getElementById('info')
	input.onfocus=function(){
		info.style.display="block";
	}
	input.onblur=function(){
		info.style.display="none";
	}
}
	</script>
</head>
<body>
	<p>11111</p>
	<p>22222</p>
	<p>33333</p>
	<span id="abc">abc</span>
	<input type="text" id="input">
	<span id="info" style="display:none;">你hao sdfwefwfwf</span>


</body>
</html>